package com.qf.day04;

import java.util.Scanner;

/**
 * 拷贝数组的方法，把原数组中的内容拷贝到新数组中
 * @param arr1 原数组
 * @param arr2 新数组
 */


public class practice
{

    public static void main(String[] args) {
      int[] arr1 = {1,2,3,4,5,6};

        int[] arr2 = new int[arr1.length];

       copyArr( arr1, arr2);
        for (int i = 0; i < arr2.length; i++) {
            System.out.print("{");
            System.out.print(arr2[i] );
            System.out.print(" }");
        }
    }
    public static void copyArr(int[] arr1,int[] arr2){
        for (int i = 0; i < arr1.length; i++) {
            arr2[i] = arr1[i];
        }
    }
}

